Skip to content

Update typingQC to align with mikrokondo and CDC #21

Open
kylacochrane wants to merge 18 commits into
devfrom
update
Open

Update typingQC to align with mikrokondo and CDC #21
kylacochrane wants to merge 18 commits into
devfrom
update

Conversation

@kylacochrane

@kylacochrane kylacochrane commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Updates to three typingQC pipeline modules to support a new mikrokondo QA field, fix a pre-existing schema mismatch, and add serovar nomenclature handling.

sequenceQC.py

  • Added wgmlst_loci_count to QA handling: captured as a warning test but returns PNC_FAIL_MESSAGE on failure
  • Fixed CHECKM_TEST constant: checkm_contaminationcheckm2_contamination to match current mikrokondo JSON schema

sistrQC.py

  • Strip non-actionable INFO: Number of cgMLST loci found message from qc_messages before reporting
  • Wzx/Wzy-only FAIL samples no longer block typingQC: serovar reportability is still checked and quality_metrics reports a warning instead of a raw FAIL message

validateSerotype.py

  • Added CDC serovar rename mappings: PanamaPanama/Houston, SendaiMiami
  • Sendai renames append a nomenclature warning to quality_metrics
  • Rename logic is table-driven for easy extension

PR checklist

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • Make sure your code lints (nf-core lint).
  • Ensure the test suite passes (nextflow run . -profile test,docker --outdir <OUTDIR>).
  • CHANGELOG.md is updated.
  • README.md is updated (including new tool citations and authors/contributors).

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

This PR is against the main branch ❌

  • Do not close this PR
  • Click Edit and change the base to dev
  • This CI test will remain failed until you push a new commit

Hi @kylacochrane,

It looks like this pull-request is has been made against the phac-nml/typingQC main branch.
The main branch on phac-nml repositories should always contain code from the latest release.
Because of this, PRs to main are only allowed if they come from the phac-nml/typingQC dev branch.

You do not need to close this PR, you can change the target branch to dev by clicking the "Edit" button at the top of this page.
Note that even after this, the test will continue to show as failing until you push a new commit.

Thanks again for your contribution!

@kylacochrane
kylacochrane changed the base branch from main to dev July 3, 2026 15:22
@kylacochrane kylacochrane changed the title Update Update typingQC to align with mikrokondo and CDC Jul 3, 2026
@kylacochrane
kylacochrane marked this pull request as ready for review July 15, 2026 17:56
@kylacochrane
kylacochrane requested a review from sgsutcliffe July 15, 2026 17:56

@emarinier emarinier left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Kyla. I left a few comments, but it looks good to me.

Comment thread bin/parse_sistrQC.py
Comment on lines +61 to +64
#QC_MESSAGES Updates
#Matches the non-actionable cgMLST loci found INFO message and strips it from qc_messages
CGMLST_LOCI_INFO_PATTERN = re.compile(r"INFO: Number of cgMLST\d+ loci found \(n=\d+\)")
def filter_qc_messages(qc_messages):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm understanding this correctly that this is parsing SISTR output (and not output we easily have control over), then this seem reasonable to me.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes exactly - it causes a lot of extra text in IRIDA Next metadata fields and serves no use for those in the lab who are analyzing the data!

Comment thread bin/validate_serotypes.py

if 'FAIL' in typingqc_upper:
return 'pending'
return 'pending', quality_metrics

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think two returned items is okay for now, but if gets more complicated, then it might be worth making a simple object to encapsulate all of it and return that object back.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed!

SAMPLE5,SALM003,https://raw.githubusercontent.com/phac-nml/typingQC/dev/tests/data/SALM003.flat_sample.json.gz,Salmonella enterica,FAILED,Kentucky
SAMPLE6,LIST001,https://raw.githubusercontent.com/phac-nml/typingQC/dev/tests/data/LIST001.flat_sample.json.gz,Listeria monocytogenes,PASSED,
SAMPLE7,LIST001,https://raw.githubusercontent.com/phac-nml/typingQC/dev/tests/data/LIST001.flat_sample.json.gz,Listeria monocytogenes,PASSED,
SAMPLE1,EC001,https://raw.githubusercontent.com/phac-nml/typingQC/update/tests/data/EC001.flat_sample.json.gz,Escherichia coli,PASSED,O157:H7

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder to update these paths later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants